package com.test.servlets;

import java.io.IOException;

import javax.ejb.EJB;
import javax.inject.Inject;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.test.ejbs.HelloEJB;
import com.test.pojos.HelloPOJO;

@WebServlet("/HelloServlet")
public class HelloServlet extends HttpServlet {
       
	@EJB
	private HelloEJB helloEJB;
	
	@Inject
	private HelloPOJO helloPOJO;

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.getWriter().println("Servlet Working");
		response.getWriter().println(helloEJB.getName());
		response.getWriter().println(helloPOJO.getMessage());
	}

}
